const UserInfo = [
  {
    uid: 3,
    name: "SilverLion",
    account: "13812345678",
    password: "Zz13779904086",
    addressId: 3,
  },
  {
    uid: 4,
    name: "GlimmerDove",
    account: "15023456789",
    password: "Zz13779904086",
    addressId: 4,
  },
  {
    uid: 5,
    name: "AzureTiger",
    account: "13734567890",
    password: "Zz13779904086",
    addressId: 5,
  },
  {
    uid: 6,
    name: "CrimsonFox",
    account: "15945678901",
    password: "Zz13779904086",
    addressId: 6,
  },
  {
    uid: 7,
    name: "SerenityHawk",
    account: "15856789012",
    password: "Zz13779904086",
    addressId: 7,
  },
  {
    uid: 8,
    name: "GoldenSwan",
    account: "15167890123",
    password: "Zz13779904086",
    addressId: 8,
  },
  {
    uid: 9,
    name: "MoonlitWolf",
    account: "13578901234",
    password: "Zz13779904086",
    addressId: 9,
  },
  {
    uid: 10,
    name: "VelvetPanther",
    account: "13989012345",
    password: "Zz13779904086",
    addressId: 10,
  },
  {
    uid: 11,
    name: "RubyRaven",
    account: "15090123456",
    password: "Zz13779904086",
    addressId: 11,
  },
  {
    uid: 12,
    name: "DuskCobra",
    account: "18234567890",
    password: "Zz13779904086",
    addressId: 12,
  },
  {
    uid: 13,
    name: "AmberFalcon",
    account: "15956789012",
    password: "Zz13779904086",
    addressId: 13,
  },
  {
    uid: 14,
    name: "WhisperingDragon",
    account: "13667890123",
    password: "Zz13779904086",
    addressId: 14,
  },
  {
    uid: 15,
    name: "MysticPhoenix",
    account: "13778901234",
    password: "Zz13779904086",
    addressId: 15,
  },
  {
    uid: 16,
    name: "ScarletJaguar",
    account: "15890123456",
    password: "Zz13779904086",
    addressId: 16,
  },
  {
    uid: 17,
    name: "LunarLeopard",
    account: "15901234567",
    password: "Zz13779904086",
    addressId: 17,
  },
  {
    uid: 18,
    name: "CopperCoyote",
    account: "18623456789",
    password: "Zz13779904086",
    addressId: 18,
  },
  {
    uid: 19,
    name: "EnchantingSparrow",
    account: "13534567890",
    password: "Zz13779904086",
    addressId: 19,
  },
  {
    uid: 20,
    name: "SapphireOwl",
    account: "18245678901",
    password: "Zz13779904086",
    addressId: 20,
  },
  {
    uid: 21,
    name: "GentleBear",
    account: "13956789012",
    password: "Zz13779904086",
    addressId: 21,
  },
  {
    uid: 22,
    name: "TwilightHeron",
    account: "15867890123",
    password: "Zz13779904086",
    addressId: 22,
  },
];

function generateRandomUserInfo() {
  const userTotal = Math.floor(Math.random() * 16) + 5; // 生成5到20之间的整数
  const startUser = Math.floor(Math.random() * (21 - userTotal)); // 生成不大于20-userTotal的整数

  return {
    userTotal,
    startUser,
  };
}

function getUserList() {
  const { userTotal, startUser } = generateRandomUserInfo();
  return UserInfo.slice(startUser, startUser + userTotal);
}

module.exports = {
  UserInfo,
  getUserList,
};
